#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

bool cmp(pair<string, int>& x, pair<string, int>& y)
{
	return x.second > y.second;
}
int main()
{
	map<string, int>mp;
	string s;
	while (getline(cin, s))
	{
		for (int i = 0, j = 0; i < s.size(); i++)
		{
			if (s[i] == ' ' || s[i] == '.')
			{
				string t = s.substr(j, i - j);
				if (isupper(t[0]))
				{
					t[0] = tolower(t[0]);
				}
				j = i + 1;
				mp[t]++;
			}
		}
		vector<pair<string, int>> v(mp.begin(), mp.end());
		sort(v.begin(), v.end(), cmp);
		for (int i = 0; i < v.size(); i++)
		{
			cout << v[i].first << ":" << v[i].second << endl;
		}
	}
	return 0;
}